Xbasic

Logical .OR.

IN THIS PAGE

Syntax

Result as L = Expression1 .OR. Expression2

Arguments

Expression1

A value or an Xbasic expression that evaluates to a value.

Expression2

A value or an Xbasic expression that evaluates to a value.

Description

When a logical AND (.AND.) is placed between two logical expressions that evaluate to logical values, the result is TRUE if the logical expressions on one or both sides of the .OR. are TRUE. This is a bitwise logical operation. The following truth table shows all the possible outcomes of an .OR. operation between two expressions that evaluate to logical values:

Using .OR.

  • If Expression1 is FALSE .OR. Expression2 is FALSE then the result is FALSE

  • If Expression1 is FALSE .OR. Expression2 is TRUE then the result is TRUE

  • If Expression1 is TRUE .OR. Expression2 is FALSE then the result is TRUE

  • If Expression1 is TRUE .OR. Expression2 is TRUE then the result is TRUE

Example:

For example, if Sales contains 2000 or State is "MA,":

SALES > 1000 .OR. STATE = "MA" --> TRUE

If Sales contains 2000 and State is "CA," or if State contains "MA," regardless of the value in Sales:

(SALES > 1000 .AND. STATE = "CA") .OR. STATE = "MA" --> TRUE

<BLOB>.OR()

See Also